* COMPLIANCE WITH DECISIONS OF THE PERMANENT COURT OF ARBITRATION
* Emilia Justyna Powell 
* Aníbal Pérez-Liñán
* 4/6/2025

use "pca1_awards.dta", clear

** Descriptives in the text
  di _N  // 210 cases processed by the Permanent Court of Arbitration between 1902 and 2020
  tab pcaweb  // 138 cases posted by the PCA, plus 72 cases identified in additional sources
  tab relevant // Compliance only meaningful for 40% the 210 cases (25.71+ 8.57+5.71)
  tab reason_exclude // In 47 cases, dispute was withdrawn, in 79 cases, the state was not required to act
  tab compdata if relevant==1 // Info on compliance for 54 of the 84 relevant cases
  tab type if relevant==1
  tab type if reason_exclude==0 
   

** Duration Models

 use "pca3_dyad_years.dta", clear
  
melogit y_full interstate mixedc                                                                               || ndrl_code : 
     est store M1
melogit y_full interstate mixedc           if award_year>1990                                                  || ndrl_code :
    est store M2
melogit y_full interstate mixedc joint_agreement contract                                                      || ndrl_code :
    est store M3
    lincom mixedc+contract
	lincom interstate - (mixedc+contract)
melogit y_full interstate mixedc joint_agreement contract  i.econ_sector2  multiple pastpca                           || ndrl_code :
    est store M4
melogit y_full interstate mixedc joint_agreement contract  i.econ_sector2  multiple pastpca v2x_libdem e_gdppc iconf  || ndrl_code :
    est store M5
	gen     casesn = 1 if e(sample)
	replace casesn = 0 if casesn==.	  

 * Table 1. PCA Compliance: Discrete-Time Duration Models
  esttab M1 M2 M3 M4 M5  /// 
      using "Table_1.rtf", replace  b(%9.2f) se	///  
	      mtitles("1.1" "1.2" "1.3" "1.4" "1.5" "1.6" ) ///
	  	  starlevels(* 0.1 ** 0.05) nobase noomit label nodepvars  ///
	      title("PCA Compliance: Discrete-Time Duration Models")   
		  
		  
* cases in Table 1
preserve 
sort ndrl_award
collapse (max) award_year casesn, by(ndrl_award)
 tab award_year if award_year>1990
 tab casesn
restore

 
 * Figure 2. Expected Time to Compliance for Different Types of Arbitration
 
 * Arbitraion Type
   gen     arb_type = 0 if type == 4
   replace arb_type = 1 if type == 5
   replace arb_type = 2 if type == 1
   label var arb_type "Arbitration type"
   label define arb_type  0 "Investor-state" 1 "Contract-based" 2 "Interstate"
   label values arb_type arb_type
 
   melogit y_full i.arb_type                                 || ndrl_code :
   margins arb_type, post
   coefplot, transform(* = 1/(@b)) noci saving(ETC, replace) recast(dropline)  /// 
     mlabel mlabsize(large) format(%3.0f) msymbol(|) xtitle("Years from award to compliance", size(large))  ///
	 xsize(7) ysize(3) xlabel(0(5)10)  mlabcolor(green) mcolor(green)  

* GDP simulation 
melogit y_full interstate mixedc joint_agreement contract  i.econ_sector2  multiple v2x_libdem c.e_gdppc iconf  || ndrl_code :
sum e_gdppc
margins, at(e_gdppc=(1.041 49.492)) post
coefplot, transform(* = 1/(@b)) noci saving(ETC, replace) recast(dropline)  /// 
     mlabel mlabsize(large) format(%3.0f) msymbol(|) xtitle("Years from award to compliance", size(large))  ///
	 xsize(7) ysize(3) xlabel(0(5)40)  mlabcolor(green) mcolor(green)  	 
	 

**  Sensitivity and Selection	 
use "pca1_awards.dta", clear

* Table 2 - RIR
tab interstate scomplied if relevant ==1  , exact r
 * Fisher's exact =  0.002, 1-sided 
 * RIR calculated with: https://konfound-project.shinyapps.io/konfound-it/
 * RIR = 12, 
 
 
* Table 4 - Heckman selection model
  gen     selected = 1 if reason_exclude==0  // Selection variable
  replace selected = 0 if reason_exclude==1
  tab selected
  tab scomplied if selected==1
  
  tab selected type, r e
  tab selected econ_sector2 , r e
  
   heckprobit scomplied interstate mixedc  ///
    , select(selected = interstate mixedc pcaweb) 
	est store M41

 * Table 4. PCA Compliance: Selection Model
  esttab M41 M41  /// 
      using "Table_4.rtf", replace  b(%9.2f) se	///  
	  	  starlevels(* 0.05) nobase noomit label nodepvars  ///
	      title("PCA Compliance: Selection Model")   